package com.eastfair.imaster.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.core.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 产品表
 * </p>
 *
 * @author liuxiaobai
 * @since 2021-08-30
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("com_product")
@ApiModel(value = "Product", description = "产品表")
@AllArgsConstructor
public class Product extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 项目ID
     */
    @ApiModelProperty(value = "项目ID")
    @NotNull(message = "请填写项目ID")
    @TableField(value = "project_id")
    @Excel(name = "项目ID")
    private Long projectId;

    /**
     * 当前发布到的展会ID
     */
    @ApiModelProperty(value = "当前发布到的展会ID")
    @TableField(value = "exhibition_id")
    @Excel(name = "当前发布到的展会ID")
    private Long exhibitionId;

    /**
     * 公司ID
     */
    @ApiModelProperty(value = "公司ID")
    @TableField(value = "company_id")
    @Excel(name = "公司ID")
    private Long companyId;

    /**
     * 产品名称
     */
    @ApiModelProperty(value = "产品名称")
    @Size(max = 500, message = "产品名称长度不能超过500")
    @TableField(value = "name", condition = LIKE)
    @Excel(name = "产品名称")
    private String name;

    /**
     * 产品英文名称
     */
    @ApiModelProperty(value = "产品英文名称")
    @Size(max = 500, message = "产品英文名称长度不能超过500")
    @TableField(value = "en_name", condition = LIKE)
    @Excel(name = "产品英文名称")
    private String enName;

    /**
     * 产品品牌
     */
    @ApiModelProperty(value = "产品品牌")
    @Size(max = 300, message = "产品品牌长度不能超过300")
    @TableField(value = "brand", condition = LIKE)
    @Excel(name = "产品品牌")
    private String brand;

    /**
     * 产品品牌英文
     */
    @ApiModelProperty(value = "产品品牌英文")
    @Size(max = 300, message = "产品品牌英文长度不能超过300")
    @TableField(value = "en_brand", condition = LIKE)
    @Excel(name = "产品品牌英文")
    private String enBrand;

    /**
     * 产品描述
     */
    @ApiModelProperty(value = "产品描述")
    @Size(max = 65535, message = "产品描述长度不能超过65535")
    @TableField(value = "introduction", condition = LIKE)
    @Excel(name = "产品描述")
    private String introduction;

    /**
     * 产品英文介绍
     */
    @ApiModelProperty(value = "产品英文介绍")
    @Size(max = 65535, message = "产品英文介绍长度不能超过65535")
    @TableField(value = "en_introduction", condition = LIKE)
    @Excel(name = "产品英文介绍")
    private String enIntroduction;

    /**
     * 宣传视频
     */
    @ApiModelProperty(value = "宣传视频")
    @Size(max = 1024, message = "宣传视频长度不能超过1024")
    @TableField(value = "adverts_video", condition = LIKE)
    @Excel(name = "宣传视频")
    private String advertsVideo;

    /**
     * 宣传视频缩略图
     */
    @ApiModelProperty(value = "宣传视频缩略图")
    @Size(max = 1024, message = "宣传视频缩略图长度不能超过1024")
    @TableField(value = "adverts_video_image", condition = LIKE)
    @Excel(name = "宣传视频缩略图")
    private String advertsVideoImage;

    /**
     * 宣传图片
     */
    @ApiModelProperty(value = "宣传图片")
    @Size(max = 1024, message = "宣传图片长度不能超过1024")
    @TableField(value = "adverts_image", condition = LIKE)
    @Excel(name = "宣传图片")
    private String advertsImage;

    /**
     * 长图
     */
    @ApiModelProperty(value = "长图")
    @Size(max = 255, message = "长图长度不能超过255")
    @TableField(value = "long_image", condition = LIKE)
    @Excel(name = "长图")
    private String longImage;

    /**
     * 封面图
     */
    @ApiModelProperty(value = "封面图")
    @Size(max = 1200, message = "封面图长度不能超过1200")
    @TableField(value = "icon", condition = LIKE)
    @Excel(name = "封面图")
    private String icon;

    /**
     * 产品标识（新品、爆品）
     */
    @ApiModelProperty(value = "产品标识（新品、爆品）")
    @Size(max = 32, message = "产品标识（新品、爆品）长度不能超过32")
    @TableField(value = "mark", condition = LIKE)
    @Excel(name = "产品标识（新品、爆品）")
    private String mark;

    /**
     * 产品英文标识
     */
    @ApiModelProperty(value = "产品英文标识")
    @Size(max = 32, message = "产品英文标识长度不能超过32")
    @TableField(value = "en_mark", condition = LIKE)
    @Excel(name = "产品英文标识")
    private String enMark;

    /**
     * 网址
     */
    @ApiModelProperty(value = "网址")
    @Size(max = 255, message = "网址长度不能超过255")
    @TableField(value = "website", condition = LIKE)
    @Excel(name = "网址")
    private String website;

    /**
     * 销售价格
     */
    @ApiModelProperty(value = "销售价格")
    @TableField(value = "price")
    @Excel(name = "销售价格")
    private BigDecimal price;

    /**
     * 型号
     */
    @ApiModelProperty(value = "型号")
    @Size(max = 32, message = "型号长度不能超过32")
    @TableField(value = "model", condition = LIKE)
    @Excel(name = "型号")
    private String model;

    /**
     * 尺寸规格
     */
    @ApiModelProperty(value = "尺寸规格")
    @Size(max = 512, message = "尺寸规格长度不能超过512")
    @TableField(value = "size", condition = LIKE)
    @Excel(name = "尺寸规格")
    private String size;

    /**
     * 审核状态
     */
    @ApiModelProperty(value = "审核状态")
    @Size(max = 32, message = "审核状态长度不能超过32")
    @TableField(value = "verify_state", condition = LIKE)
    @Excel(name = "审核状态")
    private String verifyState;

    /**
     * 审核理由
     */
    @ApiModelProperty(value = "审核理由")
    @Size(max = 512, message = "审核理由长度不能超过512")
    @TableField(value = "verify_content", condition = LIKE)
    @Excel(name = "审核理由")
    private String verifyContent;

    /**
     * 产品第一个首字母(大写)
     */
    @ApiModelProperty(value = "产品第一个首字母(大写)")
    @Size(max = 2, message = "产品第一个首字母(大写)长度不能超过2")
    @TableField(value = "initial", condition = LIKE)
    @Excel(name = "产品第一个首字母(大写)")
    private String initial;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    @TableField(value = "sequence")
    @Excel(name = "排序")
    private Integer sequence;

    /**
     * 产品标识
     */
    @ApiModelProperty(value = "产品标识")
    @Size(max = 32, message = "产品标识长度不能超过32")
    @TableField(value = "identification", condition = LIKE)
    @Excel(name = "产品标识")
    private String identification;

    /**
     * 产品英文标识
     */
    @ApiModelProperty(value = "产品英文标识")
    @Size(max = 32, message = "产品英文标识长度不能超过32")
    @TableField(value = "en_identification", condition = LIKE)
    @Excel(name = "产品英文标识")
    private String enIdentification;

    /**
     * 是否有定制服务
     */
    @ApiModelProperty(value = "是否有定制服务")
    @TableField(value = "is_customization_services")
    @Excel(name = "是否有定制服务")
    private Integer isCustomizationServices;

    /**
     * 是否有现货
     */
    @ApiModelProperty(value = "是否有现货")
    @TableField(value = "is_spot_trading")
    @Excel(name = "是否有现货")
    private Integer isSpotTrading;

    /**
     * 可提供最小订货量
     */
    @ApiModelProperty(value = "可提供最小订货量")
    @Size(max = 50, message = "可提供最小订货量长度不能超过50")
    @TableField(value = "min_order_quantity", condition = LIKE)
    @Excel(name = "可提供最小订货量")
    private String minOrderQuantity;

    /**
     * 条形码
     */
    @ApiModelProperty(value = "条形码")
    @Size(max = 32, message = "条形码长度不能超过32")
    @TableField(value = "var_code", condition = LIKE)
    @Excel(name = "条形码")
    private String varCode;

    /**
     * 是否为草稿
     */
    @ApiModelProperty(value = "是否为草稿")
    @TableField(value = "is_draft")
    @Excel(name = "是否为草稿")
    private Integer isDraft;

    /**
     * 可见范围,0全部可见，1仅客户池观众，2仅预登记观众可见，3仅客户池并且预登记观众可见
     */
    @ApiModelProperty(value = "可见范围,0全部可见，1仅客户池观众，2仅预登记观众可见，3仅客户池并且预登记观众可见")
    @TableField(value = "scope")
    @Excel(name = "可见范围,0全部可见，1仅客户池观众，2仅预登记观众可见，3仅客户池并且预登记观众可见")
    private Integer scope;

    /**
     * 是否生效(默认1：可用 0:不可用)
     */
    @ApiModelProperty(value = "是否生效(默认1：可用 0:不可用)")
    @TableField(value = "is_enable")
    @Excel(name = "是否生效(默认1：可用 0:不可用)")
    private Integer isEnable;

    /**
     * 是否删除(默认0：未删除 1:已删除)
     */
    @ApiModelProperty(value = "是否删除(默认0：未删除 1:已删除)")
    @TableField(value = "is_delete")
    @Excel(name = "是否删除(默认0：未删除 1:已删除)")
    private Integer isDelete;


    @Builder
    public Product(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Long projectId, Long exhibitionId, Long companyId, String name, String enName, 
                    String brand, String enBrand, String introduction, String enIntroduction, String advertsVideo, String advertsVideoImage, 
                    String advertsImage, String longImage, String icon, String mark, String enMark, String website, 
                    BigDecimal price, String model, String size, String verifyState, String verifyContent, String initial, 
                    Integer sequence, String identification, String enIdentification, Integer isCustomizationServices, Integer isSpotTrading, String minOrderQuantity, 
                    String varCode, Integer isDraft, Integer scope, Integer isEnable, Integer isDelete) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.projectId = projectId;
        this.exhibitionId = exhibitionId;
        this.companyId = companyId;
        this.name = name;
        this.enName = enName;
        this.brand = brand;
        this.enBrand = enBrand;
        this.introduction = introduction;
        this.enIntroduction = enIntroduction;
        this.advertsVideo = advertsVideo;
        this.advertsVideoImage = advertsVideoImage;
        this.advertsImage = advertsImage;
        this.longImage = longImage;
        this.icon = icon;
        this.mark = mark;
        this.enMark = enMark;
        this.website = website;
        this.price = price;
        this.model = model;
        this.size = size;
        this.verifyState = verifyState;
        this.verifyContent = verifyContent;
        this.initial = initial;
        this.sequence = sequence;
        this.identification = identification;
        this.enIdentification = enIdentification;
        this.isCustomizationServices = isCustomizationServices;
        this.isSpotTrading = isSpotTrading;
        this.minOrderQuantity = minOrderQuantity;
        this.varCode = varCode;
        this.isDraft = isDraft;
        this.scope = scope;
        this.isEnable = isEnable;
        this.isDelete = isDelete;
    }

}
